/*
 * Copyright (C) 2017-2021
 * All rights reserved, Designed By 深圳中科鑫智科技有限公司
 * Copyright authorization contact 18814114118
 */
package com.shop.cereshop.business.service.shop.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.shop.cereshop.business.dao.shop.CereShopVisitDAO;
import com.shop.cereshop.business.service.shop.CereShopVisitService;
import com.shop.cereshop.commons.domain.common.Page;
import com.shop.cereshop.commons.domain.shop.CereShopVisit;
import com.shop.cereshop.commons.domain.shop.bo.CereShopVisitBo;
import com.shop.cereshop.commons.domain.shop.vo.CereShopVisitVo;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CereShopVisitServiceImpl extends ServiceImpl<CereShopVisitDAO, CereShopVisit> implements CereShopVisitService {
    @Override
    public List<CereShopVisitVo> queryList(CereShopVisitBo bo) {
        return baseMapper.queryList(bo);
    }

    @Override
    public Page queryPageList(CereShopVisitBo bo) {
         PageHelper.startPage(bo.getPage(), bo.getPageSize());
         List<CereShopVisitVo> cereShopVisitVos = baseMapper.queryList(bo);
        PageInfo<CereShopVisitVo> pageInfo = new PageInfo<>(cereShopVisitVos);
        return new Page<>(pageInfo.getList(), pageInfo.getTotal());

    }
}
